package com.sdry.web.controller.cb;

import com.sdry.model.cb.ReportFormEntity;
import com.sdry.service.cb.ReportFormService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

/**
 * 每日结存备份
 * @author cb
 * 2019年11月1日10:01:42
 */
public class StockTaskJob implements Job {

    @Autowired
    private ReportFormService reportFormService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        //昨日的库存放到每日结存统计表里去
        List<ReportFormEntity> list = reportFormService.getStock();
        System.out.println("----库存结存每日备份执行了，时间-----前-----" + new Date());
        reportFormService.addStockTaskJob(list);
        System.out.println("----库存结存每日备份执行了，时间-----后------" + new Date());
    }
}
